package br.com.siscob.dao;

import java.util.List;

import org.hibernate.Session;

import br.com.siscob.model.CadFuncionario;
import br.com.siscob.service.FuncionarioService;
import br.com.siscob.util.HibernateUtil;


public class FuncionarioDao {
	private Session sessao;
	
	public FuncionarioDao() {
		sessao = HibernateUtil.getSessionFactory().openSession();
	}
	
	public void salvar(CadFuncionario f){
		sessao.getTransaction().begin();
		sessao.save(f);
		sessao.getTransaction().commit();
	}
	
	public List<CadFuncionario> consultarTodos(){
		FuncionarioService fs = new FuncionarioService();
		return fs.consultarTodos();
	}
}
